<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<%@ include file="/common/meta.jsp" %>
<title>主页</title>
		<link href="${ctx}/styles/master/layout.css" rel="stylesheet" type="text/css"/>
		<link href="${ctx}/styles/master/screen/basemod_msg.css" rel="stylesheet" type="text/css"/>
		<%@ include file="/common/jquery.jsp" %>
<!--[if lte IE 7]>
<link href="${ctx}/styles/master/patches/patch_layout.css" rel="stylesheet" type="text/css" />
<![endif]-->

<script type="text/javascript">
$(document).ready(function() {
$("#receiveUser").click(function(){
	 var url ="${ctx}/account/json/userchooses.action";
	 var obj = new Object();
		mm = window
				.showModalDialog(
						url,
						obj,
						'dialogHeight:500px;dialogWidth:780px;status:no;toolbar:no;resizable:no;menubar:no;location:no;scrollbars:no;dialogLeft:'
								+ (screen.width / 2.0 - 150) + ',dialogTop:170')
		if (mm != null) {
			$("#receiveUser").val(mm);
		}
});
})
</script>
<script type="text/javascript">
	$(document).ready(function() {
		var type = '${fontype}';
		var mm = '${mm}';
		if(type != null){
			if(type=="1") 
				$("#fon-2").addClass("selectTag");
			if(type=="2") 
				$("#fon-1").addClass("selectTag");
		}
		if(mm != null){
			$("#acc${mm}").addClass("active");
		}
		$("#addMessage").click(function(){
			location.href="${ctx}/app/messageinfo!input.action?mm=6";
		});
		
		$.post("${ctx}/app/messageinfo!getNoReadCount.action",{
			fontype:"2"},function(data){
				$("#notice").html(data);
			});
		$.post("${ctx}/app/messageinfo!getNoReadCount.action",{
			fontype:"1"},function(data){
				$("#system").html(data);
			});
		
	});
</script>
<style type="text/css">
  .page_margins { min-width:70px; max-width:80em; background:#fff; }
.active{
 border: 0px #a66 solid;
	   background: #f4f4f4;
	   }
.tad td{
height:18px;
}
</style>
</head>
<body >
<div class="page_margins">
  <div>
    <!-- begin: main navigation #nav -->
    <div id="nav" role="navigation" >
      <div id="tags">
        <ul>
           <li id="fon-1"><a href="${ctx}/app/messageinfo.action?fontype=2" >通知(<span id="notice">0</span>)</a></li>
           <li id="fon-2"><a href="${ctx }/app/messageinfo.action?fontype=1" >系统消息(<span id="system">0</span>)</a></li>
        </ul>
        <input type="hidden" name="fontype" value="${fontype }"/>
      </div>
    </div>
    <!-- end: main navigation -->
    <!-- begin: main content area #main -->
    <div id="main" >
      <!-- begin: #col1 - first float column -->
      <div id="col1" role="complementary">
        <div id="col1_content" class="clearfix">
        <ul id="" class="msgul">
        <li id="acc6"><a id="addMessage" href="#">发送消息</a></li>
        <li id="acc4"><a href="${ctx}/app/messageinfo.action?sr=s&mm=4&fontype=${fontype}">发件箱</a></li>
        <li id="acc5"><a href="${ctx}/app/messageinfo.action?sr=r&mm=5&fontype=${fontype}">收件箱</a>
		<ul>
		<li id="acc1"><a href="${ctx}/app/messageinfo.action?mm=1&fontype=${fontype}&sr=${sr}">今天</a></li>
		<li id="acc2"><a href="${ctx}/app/messageinfo.action?mm=2&fontype=${fontype}&sr=${sr}">昨天</a></li>
		<li id="acc3"><a href="${ctx}/app/messageinfo.action?mm=3&fontype=${fontype}&sr=${sr}">更早</a></li>
		</ul>
		</li>
	</ul>	
        </div>
      </div>
      <!-- end: #col1 -->
      <!-- begin: #col3 static column -->
      <div id="col3" role="main" >
        <div>
        <form id="mainForm" action="messageinfo!save.action" method="post" class="yform" enctype="multipart/form-data">
<table style="width: 500px;" class="tad" border="1">
<c:if test="${sr=='s'}">
<tr><td align="left" style="width:60px">收件人</td><td colspan="3" align="left"><pt:labels type="userId" argument1="${receiveUser }" single="true"></pt:labels></td></tr>
</c:if>
<c:if test="${sr=='r'}">
<tr><td align="left" style="width:60px">发件人</td><td colspan="3" align="left"><pt:labels type="userId" argument1="${sendUser }" single="true"></pt:labels></td></tr>
</c:if>
<tr><td align="left">主题</td><td colspan="3" align="left">${subject }</td></tr>
<tr><td align="left">消息类型</td>
<td style="width:70px" align="left"><pt:code category="1008" code="${type }"  width="80"></pt:code> </td>
<td align="right" width="70px">消息级别</td>
<td align="left"><font color="red"><pt:code category="1009" code="${grade }"  width="65"></pt:code> </font></td>
</tr>
				<tr id="attachment">
				<td align="left">附件</td>
				<td colspan="3" align="left">
				<c:choose><c:when test="${not empty attachment.id}">
				<a title="下载"
					href="${ctx}/servlet/annex?id=${attachment.id}">${attachment.upfileFileName}</a>
					</c:when> 
					<c:otherwise>无</c:otherwise>
					</c:choose>
				</td>
			</tr>
		<tr><td align="left">消息内容</td><td colspan="3" align="left"><textarea rows="" cols="" style="width: 400px; height: 114px" readonly="readonly">${content}</textarea></td></tr>
		<tr>
		<td>&nbsp;</td>
		<td colspan="3" align="left">
			<div class="type-button">
        <input  type="button" value="返回" class="reset" onclick="history.back()" />
</div>
</td></tr>
</table>
</form>
        </div>
         <div id="ie_clearing">&nbsp;</div>
        <!-- End: IE Column Clearing -->
      </div>
      <!-- end: #col3 -->
    </div>
    <!-- end: #main -->
  </div>
  </div>
<!-- full skip link functionality in webkit browsers -->
<script src="${ctx}/scripts/plugin/focusfix.js" type="text/javascript"></script>
</body>
</html>

